﻿using System.IO;

namespace Ascend.Runtime.Core
{
    public class FileSourceProvider : IStringSource
    {
        private readonly FileInfo file;

        public FileSourceProvider(string fileName)
        {
            file = new FileInfo(fileName);
        }

        public FileSourceProvider(FileInfo file)
        {
            this.file = file;
        }

        #region IStringSource Members

        public string Source
        {
            get
            {
                string source = File.ReadAllText(file.FullName);

                return source;
            }
        }

        #endregion
    }
}